package com.hrm.model.daoimple;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.hrm.model.dao.LanguageDAO;
import com.hrm.model.dto.insa.LanguageDTO;

public class LanguageDAOImple extends SqlMapClientDaoSupport implements LanguageDAO {

	@Override
	public List<LanguageDTO> getAllLanguage(LanguageDTO dto) {
		return (List<LanguageDTO>) this.getSqlMapClientTemplate().queryForList("LanguageMap.getAllLanguage", dto);
	}

	@Override
	public boolean deleteLanguage(LanguageDTO dto) {
		try{
			this.getSqlMapClientTemplate().delete("LanguageMap.deleteLanguage", dto);
		}catch (Exception e) {
			System.out.println(e.getMessage());
			return false;
		}
		return true;
	}

	@Override
	public boolean insertLanguage(LanguageDTO dto) {
		try{
			this.getSqlMapClientTemplate().insert("LanguageMap.insertLanguage", dto);
		}catch (Exception e) {
			System.out.println(e.getMessage());
			return false;
		}
		return true;
	}

	@Override
	public boolean updateLanguage(LanguageDTO dto) {
		try{
			this.getSqlMapClientTemplate().update("LanguageMap.updateLanguage", dto);
		}catch (Exception e) {
			System.out.println(e.getMessage());
			return false;
		}
		return true;
	}

}
